/**
 * 
 */
package com.jushu.storbox.service;

import java.util.List;

import android.content.Context;
import android.os.Handler;

import com.jushu.storbox.callback.IDownloadThumbnailCallback;
import com.jushu.storbox.entities.FileFolderInfo;
import com.jushu.storbox.vo.PagedList;
import com.huawei.sharedrive.sdk.android.exception.ClientException;
import com.huawei.sharedrive.sdk.android.modelV2.request.CopyFileRequestV2;
import com.huawei.sharedrive.sdk.android.modelV2.response.FileInfoResponseV2;
import com.huawei.sharedrive.sdk.android.modelV2.response.ServerUrlV2;
import com.huawei.sharedrive.sdk.android.modelV2.response.UserResponseV2;
import com.huawei.sharedrive.sdk.android.service.handler.AsyncTaskHandler;

public interface IRemoteFileService {

	/**
	 * 
	 * @param autoManualFlag
	 * @param context
	 * @param folderID
	 * @param des
	 * @param limit
	 * @param offset
	 * @param orderby
	 * @return
	 * @throws ClientException
	 */
	public List<FileFolderInfo> getFileFolderList(boolean autoManualFlag,
			final Context context, String ownerId, String folderID, String des, int limit,
			int offset, String orderby) throws ClientException;

	public List<FileFolderInfo> getMoveFolderDB(Context context,
			String ownerId, String folderId, String exception) throws ClientException;

	public List<FileFolderInfo> getMoveFolderList(Context context,
			String ownerId, String folderID, String des, int limit, int offset, String orderby)
			throws ClientException;
	/**
	 * 
	 * @param autoManualFlag
	 * @param context
	 * @param folderID
	 * @param des
	 * @param limit
	 * @param offset
	 * @param orderby
	 * @return
	 * @throws ClientException
	 */
	public List<FileFolderInfo> getFileFolderListPage(boolean autoManualFlag,
			final Context context, String ownerId, String folderID, String des, String orderby,
			Handler handler) throws ClientException;

	public PagedList<FileFolderInfo> getNodeListFromServer(
			final Context context, String ownerId, String folderID, String des, String orderby,int pageNo,
			Handler handler) throws ClientException;
	
	public PagedList<FileFolderInfo> searchNodeListFromServer(
			final Context context, String ownerId, String keyWords, String des, String orderby,int pageNo,
			Handler handler) throws ClientException;
	
	public List<FileFolderInfo> getFileFolderListFromServer(
			final Context context, String ownerId, String folderID, String des, String orderby,
			Handler handler) throws ClientException;

	/**
	 * 
	 * @param context
	 * @param folderID
	 * @return
	 * @throws ClientException
	 */
	public List<FileFolderInfo> getFileFolderList(Context context,
			String ownerId, String folderID);

	/**
	 * 
	 * @param context
	 * @param folderID
	 * @return
	 * @throws ClientException
	 */
	public List<FileFolderInfo> getFileFolderListPage(Context context,
			FileFolderInfo folder);

	/**
	 * 
	 * @param autoManualFlag
	 * @param context
	 * @param folderID
	 * @param des
	 * @param limit
	 * @param offset
	 * @param orderby
	 * @return
	 * @throws ClientException
	 */
	public List<FileFolderInfo> getSharedFileFolderList(boolean autoManualFlag,
			final Context context, FileFolderInfo folder, String des, int limit,
			int offset, String orderby, String shareOwnerId)
			throws ClientException;

	/**
	 * 
	 * @param fileId
	 * @return
	 */
	public FileInfoResponseV2 getFileResponse(FileFolderInfo info) throws ClientException;

	/**
	 * 
	 * @param fileId
	 * @param name
	 * @return
	 */
	public FileInfoResponseV2 renameFile(FileFolderInfo node, String name)
			throws ClientException;

	/**
	 * @param fileID
	 * @return
	 * @throws ClientException
	 */
	public String deleteFile(FileFolderInfo fileFolderInfo) throws ClientException;

	public void deleteFileAsync(final FileFolderInfo fileFolderInfomation, AsyncTaskHandler handler) throws ClientException;
	
	/**
	 * @param folderID
	 * @param request
	 * @return
	 */
	public String moveFile(FileFolderInfo file, FileFolderInfo targetFolder)
			throws ClientException;

	/**
	 * @param resourceId
	 * @param request
	 * @return FileInfoResponseV2
	 * @throws ClientException
	 */
	public FileInfoResponseV2 copyFile(String resourceOwnerId, String resourceId, CopyFileRequestV2 request)
			throws ClientException;

	/**
	 * @param context
	 * @param limit
	 * @param offset
	 * @param name
	 * @return
	 * @throws ClientException
	 */
	List<FileFolderInfo> searchRemote(Context context, int limit, int offset,
			String name) throws ClientException;

	/**
	 * @return
	 * @throws ClientException
	 */
	public String logout() throws ClientException;

	/**
	 * @param context
	 * @param userName
	 * @param password
	 * @return
	 * @throws ClientException
	 */
	public UserResponseV2 login(Context context, String userName, String password)
			throws ClientException;

	/**
	 * @see downloadThumbnailIcon 
	 * @param fileId
	 *            fileId(getThumbnailURL)
	 * @param iconPath
	 * @param callback
	 */
	public void downloadThumbnailIcon(String ownerBy, String fileId, String iconPath,
			IDownloadThumbnailCallback callback);

	/**
	 * @see downloadShareThumbnailIcon
	 * @param ownerID
	 * @param fileId
	 * @param filePath
	 * @param callback
	 */
	public void downloadShareThumbnailIcon(String ownerID, String fileId,
			String iconPath, final IDownloadThumbnailCallback callback);

	/**
	 * @see shareFileSaveMyCloud
	 * @param srcOwnerId
	 * @param destFolderId
	 * @param srcFileIdList
	 * @param callback
	 */
	public void shareFileSaveMyCloud(String targetOwnerId, final String srcOwnerId,
			final String destFolderId, final List<String> srcFileIdList,
			final IFileRemoteServiceCallback callback);

	public void shareFileSaveMyCloud(final String srcOwnerId, final String destOwnerId,
			final String destFolderId, final String srcFileId,
			final IFileRemoteServiceCallback callback);

	/***
	 * @param folderisChange
	 * @param fileIsChange
	 */
	public boolean getResourceIsChange();
	
	/**
	 * 	
	 * @param type
	 * @return 
	 * @throws ClientException
	 */
	public ServerUrlV2 getServerAddress(String type) throws ClientException;

	public boolean isFileUpdate(Context context, FileFolderInfo info)  throws ClientException;

}
